From: emellor@leeni.uk.xensource.com Date: Tue, 23 May 2006 15:14:03 +0000 (+0100) Subject: Fix xspy_get_permissions -- you can't increment the perms pointer when X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16025^2~33 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=8b8e97bb5bceb52d42d2aa339ab44f082035d5b9;p=xen.git Fix xspy_get_permissions -- you can't increment the perms pointer when iterating and expect to be able to free that pointer afterwards. Signed-off-by: Ewan Mellor --- diff --git a/tools/python/xen/lowlevel/xs/xs.c b/tools/python/xen/lowlevel/xs/xs.c index c900c5ed51..348e1fe656 100644 --- a/tools/python/xen/lowlevel/xs/xs.c +++ b/tools/python/xen/lowlevel/xs/xs.c @@ -272,11 +272,12 @@ static PyObject *xspy_get_permissions(XsHandle *self, PyObject *args) if (perms) { PyObject *val = PyList_New(perms_n); - for (i = 0; i < perms_n; i++, perms++) { - PyObject *p = Py_BuildValue("{s:i,s:i,s:i}", - "dom", perms->id, - "read", perms->perms & XS_PERM_READ, - "write",perms->perms & XS_PERM_WRITE); + for (i = 0; i < perms_n; i++) { + PyObject *p = + Py_BuildValue("{s:i,s:i,s:i}", + "dom", perms[i].id, + "read", perms[i].perms & XS_PERM_READ, + "write", perms[i].perms & XS_PERM_WRITE); PyList_SetItem(val, i, p); }